﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace LastfmNet.Models
{
    public class TopTag : LastfmModelBase, ITag
    {
        public TopTag()
        {
            this.Name = string.Empty;
            this.Url = string.Empty;
            this.Count = 0;
        }

        public TopTag(XmlNode topTagNode)
            : this()
        {
            if (topTagNode == null) return;
            this.InitializeFromXmlNode(topTagNode);
        }

        public override void InitializeFromXmlNode(XmlNode node)
        {
            if (node == null) return;
            this.Name = node.GetChildValue("name");
            this.Url = node.GetChildValue("url");
            this.Count = node.GetChildValue("count").ToInteger();
        }

        public string Name { get; set; }

        public string Url { get; set; }

        public int Count { get; set; }
    }
}